<?php
/*
  $Id: packingslip.php,v 1.7 2003/06/20 00:40:10 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

  $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
  $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

  include(DIR_WS_CLASSES . 'order.php');
  $order = new order($oID);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<?php require(DIR_FS_TEMPLATE . 'scripts/javascript.php'); ?>
<style type="text/css">
/* <![CDATA[ */

body {
    color: #676767;
    font-size: 11px;
    font-family: Tahoma, Arial;
}

.title {
    color: #888888;
    font-size: 24px;
    font-weight: bold
}

.titlew {
    color: #bbbbbb;
    font-size: 14px;
    font-weight: bold
}

.titleb {
    color: #888888;
    font-size: 14px;
    font-weight: bold
}

table, td
{
    border-color: #000000;
    border-style: solid;
}

.tablenoborder
{
    border-color: #000000;
    border-style: solid;
    border-width: 0px;
}

.tdnoborder
{
    margin: 0;
    padding: 4px;
    border-width: 0 0 0 0;
    background-color: #ffffff;
}

table
{
    border-width: 0 0 1px 1px;
    border-spacing: 0;
    border-collapse: collapse;
}

td
{
    margin: 0;
    padding: 4px;
    border-width: 1px 1px 0 0;
    background-color: #ffffff;
}

/* ]]> */
</style>

</head>
<body>
<!-- body_text //-->
<table align="center" width="95%" class="tablenoborder">
  <tr>
    <td valign="top" class="tdnoborder" align="right"><img src="<?php echo HTTP_SERVER; ?>/data/images/admin_logo.png"></td>
  </tr>
</table>
<br>
<table align="center" width="95%" class="tablenoborder">
  <tr>
    <td width="50%" valign="top" align="left" class="tdnoborder title">
      <table align="center" width="100%" class="tablenoborder">
        <tr>
          <td class="tdnoborder title"><?php echo STORE_NAME; ?></td>   
        </tr>
        <tr>
          <td class="tdnoborder titlew">Store contact details:</td>   
        </tr>
        <tr>
          <td class="tdnoborder"><?php echo nl2br(STORE_CONTACT_ADDRESS); ?></td>
        </tr>
        <tr>
          <td class="tdnoborder titlew">Contact #</td>
        </tr>
        <tr>
          <td class="tdnoborder"><?php echo nl2br(STORE_CONTACT_NUMBER); ?></td>   
        </tr>
      </table>
    </td>
    <td width="50%" valign="middle" align="left" class="tdnoborder">
      <table align="center" width="100%" class="tablenoborder">
        <tr>
          <td class="tdnoborder titlew"><nobr>Date:</nobr></td><td class="tdnoborder"><?php echo $order->info['date_purchased']; ?></td>
        </tr>
        <tr>
          <td class="tdnoborder titlew"><nobr>Invoice #</nobr></td><td class="tdnoborder"><? echo $niceinvoicenumber; ?></td>
        </tr>
        <tr>
          <td class="tdnoborder titlew"><nobr>&nbsp;</nobr></td><td class="tdnoborder">&nbsp;</td>
        </tr>
        <tr>
          <td class="tdnoborder titlew" valign="top"><nobr>Sold to:</nobr></td><td class="tdnoborder"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>
        </tr>
        <tr>
          <td class="tdnoborder titlew"><nobr>Contact #</nobr></td><td class="tdnoborder"><?php echo $order->customer['telephone']; ?></td>
        </tr>
        <tr>
          <td class="tdnoborder titlew"><nobr>Email:</nobr></td><td class="tdnoborder"><?php echo $order->customer['email_address']; ?></td>
        </tr>
      </table>
    </td>  
  </tr>
</table>

<table align="center" class="tablenoborder" width="95%">
  <tr>
    <td valign="top" class="tdnoborder"><span class="titlew"><?php echo ENTRY_PAYMENT_METHOD; ?></span>&nbsp;<?php echo $order->info['payment_method']; ?></td>
  </tr>
</table> 
  
<br>

<table align="center" width="93%">
   <tr>
     <td>&nbsp;</td>  
     <td class="titlew"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
     <td class="titlew"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
   </tr>
<?php
    for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
      echo '<tr>' . "\n" .
           '<td valign="top" align="right">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
           '<td valign="top">' . $order->products[$i]['name'];

      if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
        for ($j=0, $k=sizeof($order->products[$i]['attributes']); $j<$k; $j++) {
          echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
          echo '</i></small></nobr>';
        }
      }

      echo '</td>' . "\n" .
           '<td valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .
           '</tr>' . "\n";
    }
?>
</table>
<br>
<table align="center" width="95%" class="tablenoborder">
  <tr>
    <td width="50%" valign="top" align="left" class="tdnoborder">
    <span class="titlew">Store bank details:</span><br>
    <?php echo nl2br(STORE_BANK_ACCOUNT); ?> 
    </td>
  </tr>
</table>
<!-- body_text_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
